package com.csw.foodRecommendation.controller;

import java.util.UUID;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.csw.foodRecommendation.entity.Cate1;
import com.csw.foodRecommendation.service.Cate1Service;
import com.csw.foodRecommendation.service.Cate2Service;
import com.csw.foodRecommendation.service.ListService;

@Controller
@RequestMapping("cate1")
public class Cate1Controller {
	@Autowired
	private Cate1Service cate1Service;
	@Autowired
	private ListService listService;
	@Autowired
	private Cate2Service cate2Service;

	@RequestMapping("add")
	public String add(Cate1 cate1, HttpServletRequest request) {
		System.out.println("cate1.name;;" + cate1.getName());
		cate1.setId(UUID.randomUUID().toString());
		cate1Service.add(cate1);

		return "redirect:/list/queryAll";

	}

}
